<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="output">
    </div>
    <script>
        // 数字1左边``
        var output = document.getElementById('output')
        var stuList = [
            {
                name: 'lemon',
                age: 18,
                gender: '女'
            },
            {
                name: 'ziJian',
                age: 20,
                gender: '男'
            },
            {
                name: 'haiQiang',
                age: 19,
                gender: '男'
            }
        ]
        var str = `
            <table border="1">
                <tr>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>性别</th>
                </tr>
        `
        for(var i = 0; i < stuList.length; i++){
            // stuList[i] 每一个对象
            str += `<tr>
                <td>${stuList[i].name}</td>
                <td>${stuList[i].age}</td>
                <td>${stuList[i].gender}</td>
            </tr>`
        }
        str += '</table>'
        output.innerHTML = str
    </script>
</body>
</html>